<template>
    <div class="search_bar_container">
        <el-row :gutter="10" class="search_bar">
            <el-col :span="3">
                <Select v-model="query.typeid" :options="searchData.custype_ls" :placeholder="'选择客户类型'"
                    :size="'small'" />
            </el-col>
            <el-col :span="3">
                <Select v-model="query.group" :options="searchData.group_ls" :placeholder="'选择分组'" :size="'small'" />
            </el-col>
            <el-col :span="3">
                <Select v-model="query.idyun" :options="searchData.yd_ls" :placeholder="'选择云店'" :size="'small'" />
            </el-col>
            <el-col :span="3">
                <Select v-model="query.orderby" :options="searchData.order_ls" :placeholder="'选择排序'" :size="'small'" />
            </el-col>
            <el-col :span="3">
                <Select v-model="query.uid_cp" :options="searchData.ucp_ls" :placeholder="'选择经手人'" :size="'small'" />
            </el-col>
            <el-col :span="3">
                <el-input v-model="query.kw" placeholder="请输入客户名称搜索" :size="'small'"> </el-input>
            </el-col>
            <el-col :span="3">
                <el-button type="primary" size="mini" @click="searchHandle">
                    <i class="el-icon-search"></i>
                    <span class="ml5">搜索</span>
                </el-button>
                <el-button plan size="mini" @click="refreshHandle">
                    <i class="el-icon-refresh"></i>
                    <span class="ml5">重置</span>
                </el-button>
            </el-col>
        </el-row>
    </div>
</template>

<script setup>
import { ref, onMounted, getCurrentInstance, watch, defineProps, defineEmits, defineExpose, onUnmounted, onBeforeUnmount } from '@vue/composition-api'
import config from "@/js/conf/Config.js"
import Select from '@/components/commV2/Select/index.vue'
// 获取当前组件实例
const { proxy } = getCurrentInstance()
const props = defineProps({
    searchData: {
        type: Object,
        default: () => ({})
    }
})

const query = ref({
    uid_cp: "",
    orderby: "",
    typeid: "",
    group: "",
    idyun: "",
    kw: "",
})

const emit = defineEmits(['search', 'refresh'])
const searchHandle = () => {
    emit('search', query.value)
}
const refreshHandle = () => {
    query.value = {
        uid_cp: "",
        orderby: "",
        typeid: "",
        group: "",
        idyun: "",
        kw: "",
    }
    emit('refresh', query.value)
}

onMounted(() => { })
defineExpose({})

</script>

<style lang="scss" scoped></style>